import request from '@/utils/request'
import { get } from 'js-cookie'

export function login(data) {
  return request({
    url: '/admin/acl/index/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/admin/acl/index/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/admin/acl/index/logout',
    method: 'post'
  })
}

export function reqGetDataList (page,limit) {
  return request ({
    url:`/admin/acl/user/${page}/${limit}`,
    method:'get',
  })
}

export const reqUsernameListInfo = (page,limit,username) => {
  return request({
    url:`/admin/acl/user/${page}/${limit}?username=${username}`,
    method:"get"
  })
}

export const reqDeathList = (id) => {
  return request ({
    url:`/admin/acl/user/remove/${id}`,
    method:'delete'
  })
}

export const reqUpOne = (data) => {
  return request.post(`/admin/acl/user/save`,data)
}


export const reqChange = (all) => {
  return request.put(`/admin/acl/user/update`,all)
}

export const reqBox = (ssr) => {
  return request.get(`/admin/acl/user/toAssign/${ssr}`)
}

export const reqBoxChange = (ur) => {
  return request.post(`/admin/acl/user/doAssign`,ur)
}
// POST /admin/acl/user/doAssign
// GET /admin/acl/user/toAssign/{userId}
// export const reqUpOne = (data) => {
//   return request({
//     url:`/admin/acl/user/save`,
//     method:'post',
//     data
//   })
// }

// /admin/acl/user/update

// POST /admin/acl/user/save

// DELETE /admin/acl/user/remove/{id}
// /admin/acl/user/{page}/{limit}

// export const user = (page,limit) => {
//   return request.get(`/admin/acl/user/${page}/${limit}`)
// }

// POST /admin/acl/index/login
// POST /admin/acl/index/logout
// GET /admin/acl/index/info

